{{include file="default/Public/header.html"}}
<form id="myform" name="myform" method="post" action='__APP__'  >
<div id="pageTop">
  <div class="cate">
      <a href='{{U url="forder/manage"}}' {{if $in.status==''}}class="selected"{{/if}} title="所有未关闭且客户已经确认的订单">所有</a>|
      <a href='{{U url="forder/manage?status=0"}}' {{if isset($in.status)&&$in.status==0}}class="selected"{{/if}} title="所有尚未付款的订单">未付款</a>|
      <a href='{{U url="forder/manage?status=1"}}' {{if $in.status==1}}class="selected"{{/if}} title="所有客户已经付款，待发货的订单">待发货</a>|
      <a href='{{U url="forder/manage?status=2"}}' {{if $in.status==2}}class="selected"{{/if}} title="所有已经发货，等待客户收货的订单">待收货</a>|
      <a href='{{U url="forder/manage?status=9"}}' {{if $in.status==9}}class="selected"{{/if}} title="所有已经完成交易的订单">完成</a>|
      <a href='{{U url="forder/manage?status=-1"}}' {{if $in.status==-9}}class="selected"{{/if}} title="所有已经关闭交易的订单">关闭</a> |
      <a href='{{U url="forder/manage?status=-1"}}' {{if $in.status==-1}}class="selected"{{/if}} title="所有已经生成，但客户尚未确认的订单">未确认</a>
  </div>
  <div class="search">
		<select name='search[field]'>
          <option value='ordernum'>订单号</option>
          <option value='username'>收货人</option>          
        </select>                    
        <select name='search[status]'>
          <option value='0'>未付款</option>
          <option value='1'>已付款</option>          
          <option value='2'>已发货</option>          
          <option value='9'>已完成</option>          
          <option value='-1'>已取消</option>          
        </select>
        <input type="text" name="search[q]" onblur="if (value ==''){value='请输入关键字'}" onfocus="if (value =='请输入关键字'){value =''}" value="请输入关键字"/>
        <button type="submit"></button>
	</div>
</div>
<div id="pageCo">
	<div class="listForm">
		<table cellpadding="0" cellspacing="0">
			<thead>
				<tr>
					<th width="35"><input type="checkbox" name="checkAll" /></th>
					<th width="160">订单号</th>										
					<th width="375">订单商品</th>					
					<th width="65">收货人</th>
					<th width="150">下单时间</th>
					<th width="65">订单状态</th>
					<th width="75">管理操作</th>
				</tr>
			</thead>
			<tbody>
			{{foreach from=$data.info item=v}}      
		      <tr>
		        <td align="center"><input type="checkbox" rel="checkbox" name="info[orderid][]" value="{{$v.orderid}}" /></td>
		        <td><a href='{{U url="forder/show?orderid=`$v.orderid`"}}' title="查看订单详细">{{$v.ordernum}}</a></td>
		        <td>
		        {{foreach from=$v.ordername item=name}}
				商品名称：<a href="{{$name.pageurl}}" target="_blank" title="商品页面">{{$name.name}}</a>　
		        {{/foreach}}
		        </td>
		        <td>{{$v.linkman}}</td>
		        <td>{{'Y-m-d H:i:s'|date:$v.create_time}}</td>		        
		        <td>
		        {{if $v.status=='0'}}<span class="lred">未付款</span>{{/if}}
		        {{if $v.status=='1'}}<span class="red">待发货</span>{{/if}}
		        {{if $v.status=='2'}}<span class="blue">待收货</span>{{/if}}
		        {{if $v.status=='9'}}<span class="green">完成</span>{{/if}}
		        {{if $v.status=='-1'}}<span class="gray">关闭</span>{{/if}}
		        </td>
		        <td>		          
		          <a href='{{U url="forder/edit?orderid=`$v.orderid`"}}' title="查看订单详情">修改</a> 
		          {{if $status==-1}}
		          	| <a href='{{U url="forder/delete?orderid=`$v.orderid`&status=`$v.status`"}}' title="测底删除订单">删除</a> <br />
		          {{/if}}
		          <!--| <a href='{{U url="forder/show?orderid=`$v.orderid`"}}' title="查看订单详情">详情</a> <br />-->
		          <!--  <a href='{{U url="forder/edit?do=edit&orderid=`$v.orderid`&status=-1"}}' onclick="return window.confirm('{{'该操作不可恢复，您确定关闭交易?'|L}}');"title="此操作会彻底关闭该订单" >关闭</a> |
		         <a href='{{U url="forder/log?orderid=`$v.orderid`"}}' title="查看订单操作记录">查看</a>-->
		        </td>
		      </tr>
		      {{foreachelse}}
		      <tr><td colspan="7">暂无记录！</td></tr>
		      {{/foreach}}
			</tbody>
		</table>	
	</div>	
	<div class="pageList">
		{{$data.pages}}
		<ul class="clearit"></ul> 
	</div>
</div>
<input type="hidden" name="m" id="module" value="forder" />
<input type="hidden" name="a" id="action" value="manage" />
<input type="hidden" name="do" id="do" value="" />
</form>
{{include file="default/Public/footer.html"}}